package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 库存预警表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_inventory_alerts")
public class InventoryAlerts extends Model<InventoryAlerts> {

    private static final long serialVersionUID = 1L;

    /**
     * 预警唯一标识
     */
    @TableId("alert_id")
    private Long alertId;
    /**
     * 商品ID（关联商品表）
     */
    @TableField("product_id")
    private Long productId;
    /**
     * 规格ID（关联规格表，如果支持多规格）
     */
    @TableField("spec_id")
    private Long specId;
    /**
     * 库存预警阈值
     */
    private Integer threshold;
    /**
     * 是否启用（0：禁用，1：启用）
     */
    @TableField("is_active")
    private Integer isActive;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public InventoryAlerts() {
        this.alertId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getAlertId() {
        return alertId;
    }

    public void setAlertId(Long alertId) {
        this.alertId = alertId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getSpecId() {
        return specId;
    }

    public void setSpecId(Long specId) {
        this.specId = specId;
    }

    public Integer getThreshold() {
        return threshold;
    }

    public void setThreshold(Integer threshold) {
        this.threshold = threshold;
    }

    public Integer getIsActive() {
        return isActive;
    }

    public void setIsActive(Integer isActive) {
        this.isActive = isActive;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "InventoryAlerts{" +
        ", alertId=" + alertId +
        ", productId=" + productId +
        ", specId=" + specId +
        ", threshold=" + threshold +
        ", isActive=" + isActive +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
